from django.conf.urls.defaults import *
from django.conf import settings

urlpatterns = patterns('',
    
    (r'^$', 'pds.views.index'),
    (r'^tasks/$', 'pds.views.tasks'),
    (r'^projects/$', 'pds.views.index', {'template':'projects'}),
    (r'^customers/$', 'pds.views.index', {'template':'customers'}),
    
    (r'^sitemap.xml$', 'pds.views.sitemap'),
    
    (r'^profile/$', 'pds.views.profile'),
    
    (r'^undo/$', 'pds.views.undo'),
    
    (r'^customer/add/$', 'pds.views.new_item', {'model_name': 'Customer'}),
    (r'^customer/edit/(?P<item_id>\w+)/$', 'pds.views.edit_item', {'model_name': 'Customer'}),
    (r'^customer/archive/(?P<item_id>\w+)/$', 'pds.views.archive_item', {'model_name': 'Customer'}),
    (r'^customer/unarchive/(?P<item_id>\w+)/$', 'pds.views.unarchive_item', {'model_name': 'Customer'}),
    
    (r'^project/add/$', 'pds.views.new_item', {'model_name': 'Project'}),
    (r'^project/edit/(?P<item_id>\w+)/$', 'pds.views.edit_item', {'model_name': 'Project'}),
    (r'^project/archive/(?P<item_id>\w+)/$', 'pds.views.archive_item', {'model_name': 'Project'}),
    (r'^project/unarchive/(?P<item_id>\w+)/$', 'pds.views.unarchive_item', {'model_name': 'Project'}),
    
    (r'^task/add/$', 'pds.views.new_item', {'model_name': 'Task'}),
    (r'^task/edit/(?P<item_id>\w+)/$', 'pds.views.edit_item', {'model_name': 'Task'}),
    (r'^task/edit_inline/$', 'pds.views.edit_inline', {'model_name': 'Task'}),
    (r'^task/get_inline/$', 'pds.views.get_inline', {'model_name': 'Task'}),
    (r'^task/archive/(?P<item_id>\w+)/$', 'pds.views.archive_item', {'model_name': 'Task'}),
    (r'^task/unarchive/(?P<item_id>\w+)/$', 'pds.views.unarchive_item', {'model_name': 'Task'}),
    (r'^task/delete/(?P<item_id>\w+)/$', 'pds.views.delete_item', {'model_name': 'Task'}),
    
    (r'^task_is_done/$', 'pds.views.task_is_done'),
    (r'^print_tasks/$', 'pds.views.print_tasks'),
    (r'^export_tasks/$', 'pds.views.export_tasks'),
    (r'^export_customers/$', 'pds.views.export_customers'),
    (r'^export_projects/$', 'pds.views.export_projects'),
    
    (r'^archive_all_done_tasks/$', 'pds.views.archive_all_done_tasks'),
    #(r'^view_archived_tasks/$', 'pds.views.view_archived_tasks'),

    (r'^my_achievements/$', 'pds.views.my_achievements'),
    (r'^achievements_ajax/$', 'pds.views.achievements_ajax'),
    (r'^project_detail/$', 'pds.views.project_detail'),
    
    (r'^about/$', 'pds.views.static_pages', {'page_name': 'about_service'}),
    (r'^about_image/(?P<image_name>.+)/$', 'pds.views.about_image'),
    (r'^terms/$', 'pds.views.terms_of_service'),
    (r'^faq/$', 'pds.views.static_pages', {'page_name': 'faq'}),
    
    (r'^get_ticket_form/$', 'pds.views.get_ticket_form'),
    (r'^post_ticket/$', 'pds.views.post_ticket'),

    (r'^hottasks/$', 'pds.views.hottasks'),
    
    (r'^add_hottask/(?P<task_id>\w+)/$', 'pds.views.add_from_hottask'),

    #(r'^openid_login/$', 'pds.views.openid_login'),
    
    #------------------------------------------------------------------------------
    
    (r'^iphone/$', 'pds.views.index', {"iphone": True}),
    (r'^iphone/tasks/$', 'pds.views.tasks', {"iphone": True}),
    (r'^iphone/projects/$', 'pds.views.tasks', {"iphone": True}),
    
    (r'^iphone/task/edit/(?P<item_id>\w+)/$', 'pds.views.edit_item', {'model_name': 'Task', "iphone": True}),
    
    (r'^iphone/task/add/$', 'pds.views.new_item', {'model_name': 'Task', "iphone": True}),
    (r'^iphone/project/add/$', 'pds.views.new_item', {'model_name': 'Project', "iphone": True}),
    
    (r'^iphone/archive_all_done_tasks/$', 'pds.views.archive_all_done_tasks', {"iphone": True}),
    (r'^iphone/undo/$', 'pds.views.undo', {"iphone": True}),
    (r'^iphone/terms/$', 'pds.views.terms_of_service', {"iphone": True}),
    (r'^iphone/hottasks/$', 'pds.views.hottasks', {"iphone": True}),
    (r'^iphone/add_hottask/(?P<task_id>\w+)/$', 'pds.views.add_from_hottask', {"iphone": True}),
    
    (r'^iphone/faq/$', 'pds.views.static_pages', {'page_name': 'faq', "iphone": True}),
    (r'^iphone/tour/$', 'pds.views.static_pages', {'page_name': 'tour', "iphone": True}),
    
    #------------------------------------------------------------------------------
    
    (r'^share_tasks/$', 'pds.views.share_tasks'),
    (r'^user/(?P<user_name>.+)/$', 'pds.views.user_page'),
    
    (r'^iphone/share_tasks/$', 'pds.views.share_tasks', {"iphone": True}),
    (r'^iphone/user/(?P<user_name>.+)/$', 'pds.views.user_page', {"iphone": True}),
    
    (r'^stat/$', 'pds.views.statistics'),
    
    #------------------------------------------------------------------------------
    
    (r'^iphone/offline/$', 'pds.views.go_offline', {"iphone": True}),
    (r'^iphone/sync/$', 'pds.views.sync_data', {"iphone": True}),
    
)
